<template>
	<div class="news1">
		<div class="news1-image">
			<router-link :to="setPath(item.id)">
				<img :src="setImage(item.logo)" />
			</router-link>
		</div>
		<div class="news1-title">
			<router-link :to="setPath(item.id)">{{item.title}}</router-link>
		</div>
	</div>
</template>

<script>
	import { mapState, mapMutations, mapActions } from 'vuex'
	import store from '@/store'
	export default {
		name: 'news1',
		props: ['item'],
		computed: {
			...mapState({
				currentMenu: state => state.MenuStore.currentMenu
			})
		},
		methods: {
			setPath: function(newsId) {
				return this.currentMenu.code + '/news' + newsId
			},
			setImage: function(url) {
				return store.state.StaticStore.baseUrl + '/data/' + url
			},
			changeArticle: function(arti) {
				store.commit("changeArticle", arti)
			}
		}
	}
</script>